<template>
  <div class="son2">
    <h2>二儿子组件</h2>
    <input type="text" :value="mother" placeholder="二儿子母亲" key="son2Mother">
    <input type="text" :value="son2BrotherWife"  key="son2BrotherWife" placeholder="二儿子嫂子姓名">
  </div>
</template>

<script>
import Import from '@/js/import.js'
export default {
  name: 'Son2',
  props: {
    mother: {
      type: String,
      default () {
        return '二儿子母亲姓名'
      }
    }
  },
  data () {
    return {
      son2BrotherWife: ''
    }
  },
  mounted () {
    Import.$on('son1InpChange', val => {
      this.son2BrotherWife = val
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.son2 {
  input {
    padding: 5px;
    margin: 2px;
  }
}
</style>
